#include "mainwindow.h"

#include "databasewindow.h"
#include "instructionwindow.h"
#include "setloginaccountwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent),
      ui(new Ui::MainWindow) {
    ui->setupUi(this);
    on_set_login_account_clicked();
}

MainWindow::~MainWindow() {
    delete ui;
}

void MainWindow::on_set_login_account_clicked() {
    this->setVisible(false);
    SetLoginAccountWindow tmp;
    tmp.exec();  // 阻塞执行
    this->setVisible(true);
}

void MainWindow::on_instruction_clicked() {
    this->setVisible(false);
    InstructionWindow tmp;
    tmp.exec();  // 阻塞执行
    this->setVisible(true);
}

void MainWindow::on_entry_console_clicked() {
    this->setVisible(false);
    DatabaseWindow tmp;
    tmp.exec();  // 阻塞执行
    this->setVisible(true);
}
